<template>
    <div class="StuBack">
        <h2>姓名:{{stuname}}</h2>
        <h2>身份:{{result}}</h2>
        <HomeworkList/>
    </div>
</template>

<script>
    import HomeworkList from "./HomeworkList";
    export default {
        name :"StuIndex",
        components:{HomeworkList},
        data(){
            return {
                stuname : sessionStorage.getItem('loginName'),
                stustatus : sessionStorage.getItem('status'),
            };
        },
        computed:{
            result(){
            let showstatus = '';
            if(this.stustatus === '0'){
                showstatus = '管理员';
            } else if (this.stustatus === '1'){
                showstatus = '老师';
            } else if (this.stustatus === '2'){
                showstatus = '学生';
            }
            return showstatus;
            }
        }
    }
</script>

<style scoped>
    .StuBack{
        background-position: center;
        height: 100%;
        width: 100%;
        background-size: cover;
        position: fixed;
    }

    .container{
        background-position: center;
        height: 100%;
        width: 100%;
        background-size: cover;
        position: fixed;
    }

    .el-menu-vertical-demo:not(.el-menu--collapse) {
        width: 200px;
        min-height: 400px;
    }
</style>